package com.taotao.controller;

import com.taotao.pojo.ItemParam;
import com.taotao.service.ItemParamService;
import com.taotao.util.TaotaoResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author hong.zheng
 * @Description商品参数controller
 * @date 2018-09-04-16:31
 **/
@Controller
@RequestMapping("/item/param")
public class ItemParamController {
    @Autowired
    private ItemParamService itemParamService;
    /**
     *
     * @param itemId
     * @return
     * @throws Exception
     */
    @RequestMapping("/queryItemParamByItemId/{itemId}")
    @ResponseBody
    public TaotaoResult queryItemParamByItemId(@PathVariable Long itemId) {
        ItemParam itemParam = itemParamService.findItemParamByItemId(itemId);
        TaotaoResult result = new TaotaoResult(itemParam);
        return result;
    }
}
